package com.fire.market.service.impl;

import com.fire.component.extension.Assert;
import com.fire.market.gateway.api.dto.UserInfo;
import com.fire.market.manager.UserManager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserQueryCoreServiceImpl implements UserQueryCoreService {

    @Resource
    private UserManager userManager;

    @Override
    public UserInfo queryUserInfo(Integer id) {
        Assert.notNull(id, "userid is null");
        return userManager.queryUserById(id);
    }

    @Override
    public void queryOpt(String telephone) {
        Assert.notNull(telephone, "telephone is null");
        userManager.createOptAndSave(telephone);
    }
}
